package br.com.felix.fwt.svg;

public class SVGStyle {

	public enum TextAnchor{
		MIDDLE("middle"); 
		
		private String value;
		private TextAnchor(String txt){
			this.value = txt;
		}
		public String toString(){
			return value;
		}
	};
	
	
	
	private SVGColor fill;

	private TextAnchor textAnchor;

	public SVGStyle fill(SVGColor color) {
		this.fill = color;
		return this;
	}

	public SVGStyle textAnchor(TextAnchor anchor) {
		this.textAnchor = anchor;
		return this;
	}
	
	public String toString(){
		StringBuilder strb = new StringBuilder();
		property(strb,"fill", fill);
		property(strb, "text-anchor",textAnchor);
		return strb.toString();
	}

	private void property(StringBuilder strb, String string, Object value) {
		if(value!=null){
			strb.append(string).append(":").append(value).append("; ");
		}
	}
}
